
	//文字框自适应
	var wordw = window.innerWidth - 24;
	var shareimg = false;
	var page = 1;
	var page_music = 1;
	var music_type;
	var mypic = '<li class="tool_li tool_plus">' + '			<h2><img src="/web/img/icon_plus.png"></h2>' + '	</li>' + '	<li class="tool_li tool_minus">' + '		<h2><img src="/web/img/icon_minus.png"></h2>' + '	</li>';
	var hasList2 = false;
	var nomusic = '<div style="padding:20px 0;text-align:center;font-size:15px;color:#999;">暂无数据...</div>';

	$(function() {

		var tdw = window.innerWidth - 140;
		$("td.tmusic_td2").css("max-width", tdw);
		$(".fixedDiv").css({
			"width": wordw,
			"margin-left": wordw / ( - 2)
		});

		//适配页面元素
		fixPage();

	});

	//适配页面元素
	function fixPage() {
		//$("#zxloading").show();
		if ($(".tedit_body").find("#media_tym").length > 0) {
			$("#form_music").val($(".tedit_body").find("#media_tym").attr("src"));
			$(".tedit_body").find("#audio_btn").remove();
		}

		var tedit_content = $(".tedit_content .article_body").html();
		if (tedit_content) $(".tedit_content").html(tedit_content);

		window.liveload = function() {
			var bw = document.body.offsetWidth;
			var f = document.getElementsByTagName("iframe");
			for (var i in f) {
				var w = 0;
				var h = 0;
				var src = f[i].src;
				if (!src) {
					break;
				}
				var arr = src.split("&");
				for (var j in arr) {
					var arr1 = arr[j].split("=");
					if (arr1[0] == 'width') {
						w = arr1[1].trim();
					} else if (arr1[0] == 'height') {
						h = arr1[1].trim();
					}
				}
				if (w > 0) {
					src = src.replace("width=" + w, "width=" + bw);
					src = src.replace("height=" + h, "height=" + bw * 5 / 7);
					if (src.indexOf('preview') > 0) {
						src = src.replace("preview", "player");
					}
					f[i].src = src;
					f[i].width = '100%';
					f[i].height = bw * 3 / 4;
				}
			}

			$("#js_cmt_mine,#js_pc_qr_code,.rich_media_title,.rich_media_meta_list,.rich_media_tool,.rich_media_area_extra").remove();
			var form_content = $(".tedit_body").html();
			form_content = form_content.replace(/pointer/g, "default").replace(/!important/g, "").replace(/for_share_img/g, "");;
			$(".tedit_body").html(form_content);
			$(".backgroundSize").css("background-size", "cover");
			$(".tedit_body *").css({
				"max-width": "100%"
			});
			$(".tedit_body table").each(function() {
				var t = $(this);
				if (t.css("float") != "left") {
					t.css({
						"width": "100%"
					});
				} else {
					t.css({
						"width": "auto"
					});
				}
			});
			$(".tedit_body iframe").css({
				"width": bw,
				"height": bw * 3 / 4
			});

			$("#zxloading").hide();
		}
	}

	//粘贴时候自动聚焦
	$("#videoUrl").live('hover',
	function() {
		$(this).focus();
	});
	

	//关闭弹层
	function close_tip() {
		$(".mask").hide();
		$(".boxCheck").hide();
		$(".dialog_newad").hide();
		$(".saleShare").removeClass("on");
		$(".text_video").removeClass("on");
	}



	//获取最终内容，标题图以外的新插入
	function getDetail() {
		//获取内容
		$(".article_title").remove();
		$(".adclick").css("cursor", "pointer");
		var tedit_content = $(".tedit_content").html();
		$(".tedit_content").remove();
		$(".tedit_body").append(tedit_content);
		var form_content = $(".tedit_body").html();
		form_content = form_content.replace(/default/g, "pointer");
		$("#form_content").val(form_content);
	}

	//确认提交
	$(".preview_share .boxYes,#dshare_save").live("click",
	function() {
		close_preview();
		//获取内容
		getDetail();
		$("#myform").submit();
	});

	//关闭弹层
	$(".preview_sclose,.close_shareimg").live("click",
	function() {
		close_preview();
	});

	//预览关闭
	function close_preview() {
		$(".preview_share,.mask,.dialog_shareimg").hide();
	}
	
	//点击效果
	function ajax_click(){
		$('#file').click();
	}
        